
local MainScene = class("MainScene", function()
    return display.newScene("MainScene")
end)

-- 导演 ??
function MainScene:ctor()
    -- 加载精灵图片到内存
    display.addSpriteFrames('fruit.plist', 'fruit.png')

    display.newSprite('mainBG.png')
        :pos(display.cx, display.cy)
        :addTo(self)

    local startBtnImages = {
        normal = '#startBtn_N.png',
        pressed = '#startBtn_S.png',
    }

    cc.ui.UIPushButton.new(startBtnImages, {scale9 = false})
        :onButtonClicked(function(event)
            -- 场景跳转
            local playScene = import('app.scenes.PlayScene').new()
            display.replaceScene(playScene, 'turnOffTiles', 0.5)
        end)
        :align(display.CENTER, display.cx, display.cy - 80)
        :addTo(self)
end

function MainScene:onEnter()
end

function MainScene:onExit()
end

return MainScene
